<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.icbc.ctpdemo.uniform_attestation.SsicManager"%>
<%@ page import="com.icbc.ssic.base.*"%>
<%@ page import="com.icbc.ssic.base.Credentials"%>
<%@ page import="java.security.PrivateKey"%>
<%@ page import="java.security.PublicKey"%>
<%@ page import="java.net.URLEncoder"%>
<%@ include file="/uniform_attestation/head_beforesignon.jsp" %>   
<%
	String sessionId = request.getParameter("dse_sessionId");
	String serverIP = SsicManager.getInstance().getSsicIp();
	String siteIP = SsicManager.getInstance().getClientIp();	  
	String siteService = SsicManager.getInstance().getSsicClientKeyName();
	PublicKey publicKey = SsicManager.getInstance().getPublicKey();
	PrivateKey privateKey = SsicManager.getInstance().getPrivateKey();
	String tsInterval = SsicManager.getInstance().getTsInterval();

	String userId = "888899998";	
	String tellerno = (String)request.getParameter("userId1");
	
	String netType = "0";
	String selBranchId = request.getParameter("branchId");	
	String selBranchName = request.getParameter("branchName");
	String selBranchLevel = request.getParameter("branchLevel");
	String serviceURL="http://"+siteIP+path+"/uniform_attestation/tellerinfo.jsp?dse_sessionId="+sessionId
				+ "&netType=" + netType
				+ "&selBranchId=" + selBranchId
				+ "&selBranchName=" + URLEncoder.encode(selBranchName)
				+ "&selBranchLevel=" + selBranchLevel;

	serviceURL = URLEncoder.encode(serviceURL);

	SSICUser user=new SSICUser(userId);
	Credentials cred=new Credentials(user,tsInterval);
	cred.generate(publicKey,privateKey);


response.sendRedirect("http://"+serverIP+"/servlet/com.icbc.ssic.base.QueryTellerInfoUtf8?"+cred.getAuthStringURL()+"&SERVICENAME="+siteService+"&serviceURL="+serviceURL+"&TELLERNO="+tellerno);
%>
